package com.tj.collection.enums;

/**
 * 催收逾期时长枚举
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2019/7/2
 * Time: 下午5:28
 */
public enum CollectionOverdueTimeEnums {
    D0(0, 0, 0, "0 days"),
    D2_D7(1, 1, 7, "1-7days"),
    D8_D15(2, 8, 15, "8-15days"),
    D16_D30(3, 16, 30, "16-30days"),
    D31_D60(4, 31, 60, "31-60days"),
    D61_D90(5, 61, 90, "61-90days"),
    OVERDUE_D90(6, 91, 36500, "Overdue 90days");

    private Integer type;

    private Integer start;

    private Integer end;

    private String desc;

    CollectionOverdueTimeEnums(Integer type, Integer start, Integer end, String desc) {
        this.type = type;
        this.start = start;
        this.end = end;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getEnd() {
        return end;
    }

    public void setEnd(Integer end) {
        this.end = end;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public static  CollectionOverdueTimeEnums getEnum(Integer type) {
        for ( CollectionOverdueTimeEnums item :  CollectionOverdueTimeEnums.values()) {
            if (item.type.equals(type)) {
                return item;
            }
        }
        return null;
    }
}
